<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>nandps: xnandps_skip_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">nandps
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xnandps__skip__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xnandps_skip_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains a design example using the NAND driver (XNandPs). </p>
<p>This example tests the skip block method of erase/read/write operations. The skip block method is useful while reading/writing images on to the flash. The flash is erased and programming by considering the bad blocks. The data is read back and compared with the data written for correctness.</p>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>None.</p>
<pre>
 MODIFICATION HISTORY:</pre><pre> Ver   Who  Date         Changes
</p>
<hr/>
<p>
 1.00  nm   12/10/2010   First release
 1.01a nm   28/02/2012   Modified the test offsets.
       ms   04/10/17     Modified Comment lines to follow doxygen rules
 2.8  akm   07/06/23    Add support for system device-tree flow.
</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a9d1b0fce8c1efde3f8879aeb0dfc3ac7"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xnandps__skip__example_8c.html#a9d1b0fce8c1efde3f8879aeb0dfc3ac7">NAND_TEST_OFFSET</a>&#160;&#160;&#160;0x01000000</td></tr>
<tr class="memdesc:a9d1b0fce8c1efde3f8879aeb0dfc3ac7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Flash Test Offset.  <a href="#a9d1b0fce8c1efde3f8879aeb0dfc3ac7">More...</a><br/></td></tr>
<tr class="separator:a9d1b0fce8c1efde3f8879aeb0dfc3ac7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a63932a130b13e06fbdfeabb7e6db84ef"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xnandps__skip__example_8c.html#a63932a130b13e06fbdfeabb7e6db84ef">NAND_TEST_LENGTH</a>&#160;&#160;&#160;0x00080000</td></tr>
<tr class="memdesc:a63932a130b13e06fbdfeabb7e6db84ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test Length.  <a href="#a63932a130b13e06fbdfeabb7e6db84ef">More...</a><br/></td></tr>
<tr class="separator:a63932a130b13e06fbdfeabb7e6db84ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a12ce7ac809b89c86c434dd46a0cd51a4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xnandps__skip__example_8c.html#a12ce7ac809b89c86c434dd46a0cd51a4">NandSkipBlockExample</a> (u32 NandDeviceId)</td></tr>
<tr class="memdesc:a12ce7ac809b89c86c434dd46a0cd51a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function runs a test on the NAND flash device using the basic driver functions.  <a href="#a12ce7ac809b89c86c434dd46a0cd51a4">More...</a><br/></td></tr>
<tr class="separator:a12ce7ac809b89c86c434dd46a0cd51a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec7794d74a6cc5fc91517214704f0e1d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xnandps__skip__example_8c.html#aec7794d74a6cc5fc91517214704f0e1d">XNandPs_SkipRead</a> (<a class="el" href="group__nandps.html#gaf0def4ad29325b821b3fd4127740dfbe">XNandPs</a> *InstancePtr, u64 Offset, u32 Length, void *DestPtr)</td></tr>
<tr class="memdesc:aec7794d74a6cc5fc91517214704f0e1d"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function reads the data from the Flash device and copies it into the specified user buffer.  <a href="#aec7794d74a6cc5fc91517214704f0e1d">More...</a><br/></td></tr>
<tr class="separator:aec7794d74a6cc5fc91517214704f0e1d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8fc271bb953ab1f471ed1c9c577c45cf"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xnandps__skip__example_8c.html#a8fc271bb953ab1f471ed1c9c577c45cf">XNandPs_SkipWrite</a> (<a class="el" href="group__nandps.html#gaf0def4ad29325b821b3fd4127740dfbe">XNandPs</a> *InstancePtr, u64 Offset, u32 Length, void *SrcPtr)</td></tr>
<tr class="memdesc:a8fc271bb953ab1f471ed1c9c577c45cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function programs the flash device(s) with data specified in the user buffer.  <a href="#a8fc271bb953ab1f471ed1c9c577c45cf">More...</a><br/></td></tr>
<tr class="separator:a8fc271bb953ab1f471ed1c9c577c45cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a306e1266e543ed16dd48ace99decf338"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xnandps__skip__example_8c.html#a306e1266e543ed16dd48ace99decf338">XNandPs_SkipErase</a> (<a class="el" href="group__nandps.html#gaf0def4ad29325b821b3fd4127740dfbe">XNandPs</a> *InstancePtr, u64 Offset, u32 Length)</td></tr>
<tr class="memdesc:a306e1266e543ed16dd48ace99decf338"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function erases length bytes in the flash device from a given offset.  <a href="#a306e1266e543ed16dd48ace99decf338">More...</a><br/></td></tr>
<tr class="separator:a306e1266e543ed16dd48ace99decf338"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xnandps__skip__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function to execute the Skip Block based Nand read/write example.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br/></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a007e1cf863dd10df6ba60491d5a65d91"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xnandps__skip__example_8c.html#a007e1cf863dd10df6ba60491d5a65d91">XNandPs_CalculateLength</a> (<a class="el" href="group__nandps.html#gaf0def4ad29325b821b3fd4127740dfbe">XNandPs</a> *InstancePtr, u64 Offset, u32 Length)</td></tr>
<tr class="memdesc:a007e1cf863dd10df6ba60491d5a65d91"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns the length including bad blocks from a given offset and length.  <a href="#a007e1cf863dd10df6ba60491d5a65d91">More...</a><br/></td></tr>
<tr class="separator:a007e1cf863dd10df6ba60491d5a65d91"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a63932a130b13e06fbdfeabb7e6db84ef"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define NAND_TEST_LENGTH&#160;&#160;&#160;0x00080000</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Test Length. </p>

<p>Referenced by <a class="el" href="xnandps__skip__example_8c.html#a12ce7ac809b89c86c434dd46a0cd51a4">NandSkipBlockExample()</a>.</p>

</div>
</div>
<a class="anchor" id="a9d1b0fce8c1efde3f8879aeb0dfc3ac7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define NAND_TEST_OFFSET&#160;&#160;&#160;0x01000000</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Flash Test Offset. </p>

<p>Referenced by <a class="el" href="xnandps__skip__example_8c.html#a12ce7ac809b89c86c434dd46a0cd51a4">NandSkipBlockExample()</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Main function to execute the Skip Block based Nand read/write example. </p>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if the example has completed successfully.</li>
<li>XST_FAILURE if the example has failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="xnandps__skip__example_8c.html#a12ce7ac809b89c86c434dd46a0cd51a4">NandSkipBlockExample()</a>.</p>

</div>
</div>
<a class="anchor" id="a12ce7ac809b89c86c434dd46a0cd51a4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NandSkipBlockExample </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>NandDeviceId</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function runs a test on the NAND flash device using the basic driver functions. </p>
<p>The function does the following tasks:</p>
<ul>
<li>Initialize the driver.</li>
<li>Erase the required length of bytes by taking bad blocks into account.</li>
<li>Write the number of bytes from given offset by taking bad blocks into account.</li>
<li>Read the number of bytes from given offset by taking bad blocks into account.</li>
<li>Compare the data read against the data Written.</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">NandDeviceId</td><td>is the XPAR_&lt;NAND_instance&gt;_DEVICE_ID value from xparameters.h.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful.</li>
<li>XST_FAILURE if failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_nand_ps___config.html#a0a1930e4ef28ad9c5d05e7bebafb14e0">XNandPs_Config::FlashBase</a>, <a class="el" href="xnandps__skip__example_8c.html#a63932a130b13e06fbdfeabb7e6db84ef">NAND_TEST_LENGTH</a>, <a class="el" href="xnandps__skip__example_8c.html#a9d1b0fce8c1efde3f8879aeb0dfc3ac7">NAND_TEST_OFFSET</a>, <a class="el" href="xnandps__cache__example_8c.html#aaa747f224cb3f776fb6ecafded15e090">ReadBuffer</a>, <a class="el" href="struct_x_nand_ps___config.html#a7fb228465433017747bbf8a9bd9601d7">XNandPs_Config::SmcBase</a>, <a class="el" href="xnandps__cache__example_8c.html#a61d7712760b0620e08f131bb16df45cd">WriteBuffer</a>, <a class="el" href="group__nandps.html#gaddb9f847fae34f6d137f591375a7c962">XNandPs_CfgInitialize()</a>, <a class="el" href="group__nandps.html#gad64edb80b795bb18ecceb9428b458903">XNandPs_LookupConfig()</a>, <a class="el" href="xnandps__skip__example_8c.html#a306e1266e543ed16dd48ace99decf338">XNandPs_SkipErase()</a>, <a class="el" href="xnandps__skip__example_8c.html#aec7794d74a6cc5fc91517214704f0e1d">XNandPs_SkipRead()</a>, and <a class="el" href="xnandps__skip__example_8c.html#a8fc271bb953ab1f471ed1c9c577c45cf">XNandPs_SkipWrite()</a>.</p>

<p>Referenced by <a class="el" href="xnandps__skip__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a007e1cf863dd10df6ba60491d5a65d91"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XNandPs_CalculateLength </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__nandps.html#gaf0def4ad29325b821b3fd4127740dfbe">XNandPs</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u64&#160;</td>
          <td class="paramname"><em>Offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function returns the length including bad blocks from a given offset and length. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is the pointer to the XNandPs instance. </td></tr>
    <tr><td class="paramname">Offset</td><td>is the flash data address to read from. </td></tr>
    <tr><td class="paramname">Length</td><td>is number of bytes to read.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>Return actual length including bad blocks.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_nand_ps___geometry.html#a27ad012d0279b497f04a927a6632a9ea">XNandPs_Geometry::BlockSize</a>, <a class="el" href="struct_x_nand_ps___geometry.html#a9894e2b2ad34941cc39bb93eb47546ca">XNandPs_Geometry::DeviceSize</a>, <a class="el" href="struct_x_nand_ps_tag.html#ae87fd6bcc9622ee7d41abdbdaad61c35">XNandPsTag::Geometry</a>, and <a class="el" href="group__nandps.html#ga5744d2e6e03eb2b815771cf660ab2e11">XNandPs_IsBlockBad()</a>.</p>

<p>Referenced by <a class="el" href="xnandps__skip__example_8c.html#aec7794d74a6cc5fc91517214704f0e1d">XNandPs_SkipRead()</a>, and <a class="el" href="xnandps__skip__example_8c.html#a8fc271bb953ab1f471ed1c9c577c45cf">XNandPs_SkipWrite()</a>.</p>

</div>
</div>
<a class="anchor" id="a306e1266e543ed16dd48ace99decf338"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XNandPs_SkipErase </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__nandps.html#gaf0def4ad29325b821b3fd4127740dfbe">XNandPs</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u64&#160;</td>
          <td class="paramname"><em>Offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function erases length bytes in the flash device from a given offset. </p>
<p>The Offset and Length must be block aligned. This functions skips bad blocks.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is the pointer to the XNand instance. </td></tr>
    <tr><td class="paramname">Offset</td><td>is the flash address to start erasing from. </td></tr>
    <tr><td class="paramname">Length</td><td>is number of bytes to erase.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful.</li>
<li>XST_FAILURE if error in erase.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_nand_ps___geometry.html#a27ad012d0279b497f04a927a6632a9ea">XNandPs_Geometry::BlockSize</a>, <a class="el" href="struct_x_nand_ps_tag.html#ae87fd6bcc9622ee7d41abdbdaad61c35">XNandPsTag::Geometry</a>, <a class="el" href="struct_x_nand_ps___geometry.html#aba602d679c47c2a568b36b3c504dd440">XNandPs_Geometry::NumBlocks</a>, <a class="el" href="group__nandps.html#ga22b4e2bc1af7e4bfecd4428c25a77bb8">XNandPs_EraseBlock()</a>, and <a class="el" href="group__nandps.html#ga5744d2e6e03eb2b815771cf660ab2e11">XNandPs_IsBlockBad()</a>.</p>

<p>Referenced by <a class="el" href="xnandps__skip__example_8c.html#a12ce7ac809b89c86c434dd46a0cd51a4">NandSkipBlockExample()</a>.</p>

</div>
</div>
<a class="anchor" id="aec7794d74a6cc5fc91517214704f0e1d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XNandPs_SkipRead </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__nandps.html#gaf0def4ad29325b821b3fd4127740dfbe">XNandPs</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u64&#160;</td>
          <td class="paramname"><em>Offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>DestPtr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function reads the data from the Flash device and copies it into the specified user buffer. </p>
<p>This function considers bad blocks and skips them to read next blocks.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is the pointer to the XNandPs instance. </td></tr>
    <tr><td class="paramname">Offset</td><td>is the flash data address to read from. </td></tr>
    <tr><td class="paramname">Length</td><td>is number of bytes to read. </td></tr>
    <tr><td class="paramname">DestPtr</td><td>is the destination address to copy data to.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful.</li>
<li>XST_FAILURE if fail.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_nand_ps___geometry.html#a27ad012d0279b497f04a927a6632a9ea">XNandPs_Geometry::BlockSize</a>, <a class="el" href="struct_x_nand_ps___geometry.html#a9894e2b2ad34941cc39bb93eb47546ca">XNandPs_Geometry::DeviceSize</a>, <a class="el" href="struct_x_nand_ps_tag.html#ae87fd6bcc9622ee7d41abdbdaad61c35">XNandPsTag::Geometry</a>, <a class="el" href="xnandps__skip__example_8c.html#a007e1cf863dd10df6ba60491d5a65d91">XNandPs_CalculateLength()</a>, <a class="el" href="group__nandps.html#ga5744d2e6e03eb2b815771cf660ab2e11">XNandPs_IsBlockBad()</a>, and <a class="el" href="group__nandps.html#ga8e72425d265074f1c2f8c66edfd22857">XNandPs_Read()</a>.</p>

<p>Referenced by <a class="el" href="xnandps__skip__example_8c.html#a12ce7ac809b89c86c434dd46a0cd51a4">NandSkipBlockExample()</a>.</p>

</div>
</div>
<a class="anchor" id="a8fc271bb953ab1f471ed1c9c577c45cf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XNandPs_SkipWrite </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__nandps.html#gaf0def4ad29325b821b3fd4127740dfbe">XNandPs</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u64&#160;</td>
          <td class="paramname"><em>Offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>SrcPtr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function programs the flash device(s) with data specified in the user buffer. </p>
<p>This function considers bad blocks and skips them.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is the pointer to the XNandPs instance. </td></tr>
    <tr><td class="paramname">Offset</td><td>is the flash data address to write to. </td></tr>
    <tr><td class="paramname">Length</td><td>is number of bytes to write. </td></tr>
    <tr><td class="paramname">SrcPtr</td><td>is the source address to write the data from.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful.</li>
<li>XST_FAILURE if fail.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_nand_ps___geometry.html#a27ad012d0279b497f04a927a6632a9ea">XNandPs_Geometry::BlockSize</a>, <a class="el" href="struct_x_nand_ps___geometry.html#a9894e2b2ad34941cc39bb93eb47546ca">XNandPs_Geometry::DeviceSize</a>, <a class="el" href="struct_x_nand_ps_tag.html#ae87fd6bcc9622ee7d41abdbdaad61c35">XNandPsTag::Geometry</a>, <a class="el" href="xnandps__skip__example_8c.html#a007e1cf863dd10df6ba60491d5a65d91">XNandPs_CalculateLength()</a>, <a class="el" href="group__nandps.html#ga5744d2e6e03eb2b815771cf660ab2e11">XNandPs_IsBlockBad()</a>, and <a class="el" href="group__nandps.html#gaebab330d0fd9efef74c26a50b5829d9f">XNandPs_Write()</a>.</p>

<p>Referenced by <a class="el" href="xnandps__skip__example_8c.html#a12ce7ac809b89c86c434dd46a0cd51a4">NandSkipBlockExample()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
